// import { WarningModel } from '@/models'
const defaultState = () => {
    return {
        addedRoutes: [],
        top: [],
        topPath: '',
        aside: [],
        badges: {
            deviceStatusWarning: 0
        },
        routerNames: []
    }
}

const getters = {}

const mutations = {
    setTop(state, routes) {
        state.top = routes
    },
    setAside(state, routes) {
        state.aside = routes
    },
    setRouterNames(state, routerNames) {
        state.routerNames = routerNames
    }
}

const actions = {
    setTop({ commit, state }) {
        console.log('set top called')
    }
    // queryBadge({ commit, state }) {
    //     const modelEvent = new WarningModel()
    //     modelEvent.waringCount().then(res => {
    //         state.badges = { ...state.badges, deviceStatusWarning: res }
    //     })
    // }
}

export default {
    namespaced: true,
    state: defaultState(),
    getters,
    mutations,
    actions
}
